package com.kehutong.charge.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.kehutong.charge.util.enums.ChargeOrderStatusEnum;
import com.kehutong.charge.util.enums.CommonEnum;
import com.kehutong.common.util.BigDecimalUtils;
import com.kehutong.common.util.ConvertUtils;
import org.coraframework.util.Objects;

import java.math.BigDecimal;
import java.sql.Timestamp;

/**
 * @program: kht
 * @description: 临时账单导出
 * @author: jian Ye
 * @create: 2021/8/9
 **/
@ColumnWidth(15)
@ExcelIgnoreUnannotated
public class ChargeOrderInterimExcelVO {

    @ColumnWidth(25)
    @ExcelProperty(value="订单编号")
    private String interimOrderNo;

    @ColumnWidth(25)
    @ExcelProperty(value="关联账单")
    private String interimBillNo;

    @ExcelProperty(value="缴费人")
    private String chargeName;

    @ExcelProperty(value="订单金额")
    private String orderAmount;

    private ChargeOrderStatusEnum orderStatus;
    @ExcelProperty(value="订单状态")
    private String orderState;

    private CommonEnum payMethod;
    @ExcelProperty(value="支付方式")
    private String payMethodStr;

    @ColumnWidth(25)
    @ExcelProperty(value = "提交时间")
    private Timestamp createTime;


    public String getOrderAmount() {
        return orderAmount;
    }

    /**特殊处理*/
    public void setOrderAmount(String orderAmount) {
        this.orderAmount = BigDecimalUtils.parse(orderAmount);
    }

    public String getInterimOrderNo() {
        return interimOrderNo;
    }

    public void setInterimOrderNo(String interimOrderNo) {
        this.interimOrderNo = interimOrderNo;
    }

    public String getInterimBillNo() {
        return interimBillNo;
    }

    public void setInterimBillNo(String interimBillNo) {
        this.interimBillNo = interimBillNo;
    }


    public String getChargeName() {
        return chargeName;
    }

    public void setChargeName(String chargeName) {
        this.chargeName = ConvertUtils.toNoNullString(chargeName);
    }

    public ChargeOrderStatusEnum getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(ChargeOrderStatusEnum orderStatus) {
        this.orderStatus = orderStatus;
    }

    public String getOrderState() {
        return orderStatus.getDesc();
    }

    public CommonEnum getPayMethod() {
        return payMethod;
    }

    public void setPayMethod(CommonEnum payMethod) {
        this.payMethod = payMethod;
    }

    //特殊处理
    public String getPayMethodStr() {
        if(Objects.isNull(payMethod)){
            return "--";
        }
        return ConvertUtils.toNoNullString(payMethod.getDesc());
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }
}
